import request from '@/utils/http'
import { BaseResult, PaginationResult } from '@/types/axios'

export class TypeService {
  // 获取分类列表
  static getChildCate(pid: number) {
    return request.get<BaseResult<PaginationResult<any>>>({
      url: '/child_cate_list',
      params: { pid }
    })
  }
  // 新增分类
  static addChildCate(data: any) {
    return request.post<BaseResult<PaginationResult<any>>>({
      url: '/add_cate',
      data
    })
  }
  // 更新分类
  static updateChildCate(data: any) {
    return request.post<BaseResult<PaginationResult<any>>>({
      url: '/update_cate',
      data
    })
  }
  // 删除分类
  static delChildCate(id: number) {
    return request.post<BaseResult>({
      url: '/del_cate',
      data: { id }
    })
  }
}
